<template>
	<!-- <van-tabbar v-model="active" @change="changeFn">
		<van-tabbar-item icon="home-o" to="/home">标签</van-tabbar-item>
		<van-tabbar-item icon="shopping-cart-o" to="/cart">标签</van-tabbar-item>
		<van-tabbar-item icon="friends-o" to="/login">标签</van-tabbar-item>
	</van-tabbar> -->

	<van-tabbar route v-show="!$route.meta.flag" placeholder>
		<van-tabbar-item replace icon="home-o" to="/home">首页</van-tabbar-item>
		<van-tabbar-item replace icon="shopping-cart-o" to="/cart">购物车</van-tabbar-item>
		<van-tabbar-item replace icon="friends-o" to="/user" v-if="userId">个人中心</van-tabbar-item>
		<van-tabbar-item replace icon="friends-o" to="/login" v-else>登录</van-tabbar-item>
	</van-tabbar>
</template>
<script setup lang='ts'>

// import { ref, type Ref } from 'vue'
// const active: Ref<number> = ref(0)

// const changeFn = (index: number)=>{
// 	active.value = index
// }

import { useUserStore } from '@/store/userStore';
import { storeToRefs } from 'pinia'

const userStore = storeToRefs(useUserStore())
const { userId } = userStore



</script>
<style scoped>

</style>